#!/bin/bash
#./build.sh leetcode

DEFAULT_SIGN="go"
GO_VERSION="go1.16"
SIGN=${1:-$DEFAULT_SIGN}

if [[ "$SIGN" == "dev" ]]; then
    $GO_VERSION run main.go
    exit 0
fi

# ALLOW_SIGN="go,leetcode"
# if [[ "${ALLOW_SIGN/$SIGN/}" == "$ALLOW_SIGN" ]]; then
#     echo "Err Sign '$SIGN'!"
#     exit 1
# fi

case "$SIGN" in
    "go")
        $GO_VERSION run 04-language/golang/main.go
        ;;
    "leetcode")
        $GO_VERSION run 02-algorithm/leetcode/main.go
        ;;
    *)
        echo "Err Action '$ACTION'!"
esac